﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Prism.Regions;
using Astor.Modules.DataSources.Screens.List;
using Microsoft.Practices.Unity;
using Astor.Modules.DataSources.Services;
using Astor.UI.Framework;
using Astor.Modules.DataSources.Screens.Details;
using Astor.Modules.DataSources.Models;

namespace Astor.Modules.DataSources
{
    public class DataSourcesModule : IModule
    {
        public DataSourcesModule(IRegionManager regionManager, IUnityContainer container)
        {
            _regionManager = regionManager;
            _container = container;
        }

        public void Initialize()
        {
            //services
            _container.RegisterType(typeof(IDataSourcesService), typeof(DataSourcesService), new ContainerControlledLifetimeManager());

            //view models
            _container.RegisterType(typeof(DataSourceListViewModel));
            _container.RegisterType(typeof(DataSourceDetailsViewModel));

            //views
            _regionManager.RegisterViewWithRegion("DataSourcesRegion", typeof(DataSourceListView));
        }

        private IRegionManager _regionManager;
        private IUnityContainer _container;

    }
}
